/*
 * CN_PARTY_ENTER.cpp
 *
 *  Created on: 2013. 5. 21.
 *      Author: the2
 */


#include "../../User.h"
#include "dungeon.h"

namespace ProjectZ { namespace NCommand { namespace NDungeon {

void CN_PARTY_ENTER::OnExecute(User * pUser, ::Network::Packet * pPacket)
{
	/*
	 * CN_PARTY_ENTER		0x1106
	{
		u32	party_seq;
		u16	map_tid		// 맵ID
		u16	pos_x;		// 세팅될X좌표
		u16	pos_y;		// 세팅될 Y좌표
		u16	degree;		// 방향 벡터(보고있는 방향 0:RIGHT, 90:DOWN..)
	}

	SN_PARTY_ENTER		0x1107
	{
		s16	ack;
		u16	map_tid		// 맵ID
		u16	pos_x;		// 세팅될X좌표
		u16	pos_y;		// 세팅될 Y좌표
		u16	degree;		// 방향 벡터(보고있는 방향 0:RIGHT, 90:DOWN..)
	}
	 */

//	PREPARE_PACKET;
//
//	::Logger::GETLOG()->ToFile(::Logger::DEBUG, "GID \t%d CS_PARTY_ENTER", pUser->GetGID());
//
//	int party_seq = 0;
//	int map_tid = 0;
//	int pos_x = 0;
//	int pos_y = 0;
//	int degree = 0;
//
//	pPacket->ParseMsg("%d%2d%2d%2d%2d", &party_seq, &map_tid, &pos_x, &pos_y, &degree);
//
//	// leave world
//	WorldPlayerDelete(pUser);
//
//	// enter room
//	::ProjectZ::NGame::CBaseSpace *pSpace = pUser->InvitedSpace;
////		::GameBase::Space::PLAYERTREE & playerTree = pSpace->GetPlayerTree();
////		if( playerTree.size() >= pSpace->GetInfo().m_MaxPlayerCount )
////		{
////			::Logger::GETLOG()->ToFile(::Logger::DEBUG, "WARNING: GID \t%d CS_PARTY_ENTER, user full. current=%d", pUser->GetGID(), playerTree.size());
////			return;
////		}
//
//	pUser->SetSpace(pSpace);
//	pSpace->EnterPlayer(pUser);
//
//
//
//	// send party enter
//	::Network::Packet * pNoti = ::Network::GETPACKETPOOL()->SEND_NEW();
//	pNoti->MsgCat("%2d%2d%2d%2d%2d", ACK_OK, map_tid, pos_x, pos_y, degree);
//	pNoti->MakePacket(CMD_SN_PARTY_ENTER);
//	pSpace->SendToMessageAll(pNoti);
//
//	// send dungeon detail info
//	pUser->SendOneshotEncrypt(&pSpace->DungeonDetailInfoPacket);
//
//	pUser->player_info.old_x = pUser->player_info.x;
//	pUser->player_info.old_y = pUser->player_info.y;
//	pUser->player_info.old_degree = pUser->player_info.degree;
//
//	pUser->player_info.DungeonInfo.combo_steak = 0;
//
//	pUser->player_info.bReadyFight = false;
}

} /*NDungeon*/ } /*NCommand*/ } /*ProjectZ*/
